package com.cindata

import org.grails.plugins.excelimport.AbstractExcelImporter
import org.grails.plugins.excelimport.ExcelImportService

class RepaymentExcelImporter extends AbstractExcelImporter
{

    /*******************按照实体将excel对应的列进行排序列出*******************************/
    static Map CONFIG_ESTATEIMPORT_COLUMN_MAP = [sheet: '还款表模板',
        startRow: 1,
        columnMap: ['A': 'contractNo', // '贷款合同号'
            'B': 'repaymentDate', // '还款年月'
            'C': 'repaymentType', //'还款类型'
            'D': 'shouldRepaymentAmount', //'应还款金额（元）'
            'E': 'shouldRepaymentCapital', // '应还款本金（元）'
            'F': 'shouldRepaymentInterest', // '应还款利息（元）'
            'G': 'practicalChargeBackDate', //'实际扣款日期'
            'H': 'practicalRepaymentAmount', // '实际还款金额（元）'
            'I': 'practicalRepaymentCapital', // '实际还款本金（元）'
            'J': 'practicalRepaymentInterest', //'实际还款利息（不含罚息）（元）'
            'K': 'practicalRepaymentFine', //'实际还罚息（不含罚息）（元）'
            'L': 'overdueDate', //'逾期年月'
            'M': 'overdueState', // '逾期状态'
            'N': 'continuousOverdueNumber', // '连续逾期期数'
            'O': 'fineAmount', //'罚息金额（元）'
            'P': 'prepaymentType', //'提前还款类型'
            'Q': 'beforePrepaymentDuration', //'提前还款缩期前期数（月）'
            'R': 'afterPrepaymentDuration', // '提前还款缩期后期数（月）'
        ]]

    /************执行读取excel方法************/
    def getExcelImportService()
    {
        ExcelImportService.getService()
    }

    public RepaymentExcelImporter()
    {
        //super(fileName)
    }

    List<Map> getEstates()
    {
        excelImportService.columns(workbook, CONFIG_ESTATEIMPORT_COLUMN_MAP)
    }

}
